# Maintainer:
pkgname=qbs
pkgver=2.3.0
pkgrel=0
pkgdesc="Cross platform Qt build tool"
url="https://wiki.qt.io/Qbs"
arch="all"
license="LGPL-3.0-or-later AND GPL-2.0-or-later"
makedepends="clang cmake qt6-qtbase-dev qt6-qt5compat-dev samurai"
source="https://download.qt.io/official_releases/qbs/$pkgver/qbs-src-$pkgver.tar.gz"
builddir="$srcdir/qbs-src-$pkgver"
options="!check" # todo

build() {
	CC=clang CXX=clang++ \
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DWITH_TESTS="$(want_check && echo ON || echo OFF)" \
		-DQBS_LIBEXEC_INSTALL_DIR=lib/qbs
	cmake --build build
}

check() {
	ctest -j6 --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	rm -rf "$pkgdir"/usr/share/qbs/examples/
}

sha512sums="
6611ce02b0dc4f4a0cc68a13a7c684c07061d3fff57d2ca16470fffa253ff23f45349d86ad4ba4c0eab681f74f3c92cddd85daedf1f31fd1a7eae5bddb606cb6  qbs-src-2.3.0.tar.gz
"
